package cn.javabb.core.service.sys;


import cn.javabb.core.base.BaseService;
import cn.javabb.core.entity.sys.UsersRolesDO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UsersRolesService extends BaseService<UsersRolesDO> {
    /*删除用户角色*/
    @Transactional(rollbackFor = Exception.class)
    public boolean deleteByRoleId(Integer roleId) {
        UsersRolesDO ur = new UsersRolesDO().setRoleId(roleId);
        return this.deleteByWhere(ur)>0;
    }
    /*删除用户角色*/
    @Transactional(rollbackFor = Exception.class)
    public boolean deleteByUserId(Integer userId) {
        UsersRolesDO ur = new UsersRolesDO().setUserId(userId);
        return this.deleteByWhere(ur)>0;
    }
}
